package com.graduation.vaccine.utils;

/**
 * @Author:ZhaoJunYao
 * @FileName:
 * @Date:Created in  2022/4/16 16:53
 * @Version:
 * @Description:七牛云上传图片工具类
 */

public class QiniuCloudUtil {

    // 设置需要操作的账号的AK和SK
    private static final String ACCESS_KEY = "DJanZ3gso09zRdq0myraKknJMgMRVqkQ5GrJ-fi0";
    private static final String SECRET_KEY = "lNdKYdcTOrwsV9LSp6vm7d-p13vR6hRShv-84hJN";

    // 要上传的空间
    private static final String bucketname = "graduation-image01";

    // 图片允许的后缀扩展名
    public static String[] IMAGE_FILE_EXTD = new String[]{"png", "bmp", "jpg", "jpeg", "pdf"};

    public static boolean isFileAllowed(String fileName) {
        for (String ext : IMAGE_FILE_EXTD) {
            if (ext.equals(fileName)) {
                return true;
            }
        }
        return false;
    }
}
